home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / Newton Platform Info / Newton 2.0 Sample Code / Endpoints / Basic Modem-2 / Basic Modem.text < prev    next >
Encoding:
Text File  |  1995-11-20  |  22.8 KB  |  773 lines  |  [TEXT/MPS ]

  1. // Text of project Basic Modem written on 11/20/95 at 16:24
  2. // Beginning of text file Project Data
  3. // Copyright © 1994-1995 Apple Computer, Inc. All rights reserved
  4.  
  5. constant kAction_Connect := 'connect;
  6. constant kAction_Listen := 'listen;
  7.  
  8. constant kState_Disconnected := 0;    // ready-to-go (default state)
  9. constant kState_Listen := 1;        // preparation for (asynchronous) listen
  10. constant kState_Listening := 2;        // in-process of (asynchronous) listen
  11. constant kState_Connect := 3;        // preparation for (asynchronous) connect
  12. constant kState_Connecting := 4;    // in-process of (asynchronous) connect
  13. constant kState_Connected := 5;        // connected (requires disconnect)
  14. constant kState_Disconnecting := 6;    // in-process of (asynchronous) disconnect
  15.  
  16. constant kMessage_Disconnected := "Ready to connect…";
  17. constant kMessage_Listening := "Waiting for connection...";
  18. constant kMessage_Connecting := "Connecting...";
  19. constant kMessage_Connected := "Connected, awaiting disconnect...";
  20. constant kMessage_Disconnecting := "Disconnecting, please wait...";
  21. constant kMessage_NoPhoneNumber := "Please specify a phone number to dial.";
  22. constant kMessage_ConnectFailed := "Connection not established; no response.";
  23. constant kMessage_ConnectECFailed := "A reliable connection could not be established.";
  24. constant kMessage_BufferOverrun := "The communications data buffer was overrun and has been reset.";
  25. constant kMessage_LostConnection := "The connection seems to have dropped.";
  26. constant kMessage_ModemNotResponding := "The modem is not responding.";
  27. constant kMessage_ModemPhoneLineBusy := "The line is busy.";
  28. constant kMessage_ModemLineNoAnswer := "There was no answer.";
  29. constant kMessage_ModemNoDialtone := "There is no dialtone.";
  30. constant kMessage_ModemNotFound := "There does not appear to be a modem attached to this unit.";
  31. constant kMessage_Timeout := "The connection seems to have timed out.";
  32. constant kMessage_PortInUse := "Another application seems to be using the communications port.";
  33. // End of text file Project Data
  34. // Beginning of file protoDisconnectSlip
  35.  
  36. // Before Script for "_userproto000"
  37. // Copyright © 1994-1995 Apple Computer, Inc. All rights reserved.
  38.  
  39.  
  40. _userproto000 :=
  41.     {viewBounds: {left: 0, top: 0, right: 108, bottom: 44},
  42.      viewJustify: 80,
  43.      ReorientToScreen: ROM_DefRotateFunc,
  44.      _proto: @179
  45.     };
  46.  
  47. _view000 :=
  48.     {viewBounds: {left: 8, top: 8, right: 104, bottom: 40},
  49.      viewJustify: 2,
  50.      text:
  51.        "Disconnecting...
  52.        Please Wait...",
  53.      _proto: @218
  54.     };
  55. AddStepForm(_userproto000, _view000);
  56.  
  57.  
  58.  
  59.  
  60. constant |layout_protoDisconnectSlip| := _userproto000;
  61. // End of file protoDisconnectSlip
  62. // Beginning of file Basic Modem.t
  63.  
  64. // Before Script for "vMainApp"
  65. // Copyright © 1994-1995 Apple Computer, Inc. All rights reserved.
  66.  
  67.  
  68. vMainApp :=
  69.     {
  70.      MShowModemInfo:
  71.        DefConst('kModemInfoOptions,
  72.                [    {    label:        kCMOModemConnectSpeed,
  73.                        type:        'option,
  74.                        opCode:        opGetCurrent,
  75.                        result:        nil,
  76.                        form:        'number,
  77.                        data:        0,    },
  78.                    
  79.                    {    label:        kCMOModemECType,
  80.                        type:        'option,
  81.                        opCode:        opGetCurrent,
  82.                        result:        nil,
  83.                        form:        'number,        
  84.                        data:        0,    },
  85.                ]);
  86.        
  87.        func()
  88.        begin
  89.            if fEndPointState <> kState_Connected then
  90.                return :MNotify("Not connected.");
  91.            
  92.            local option := fEndPoint:Option(kModemInfoOptions, nil);
  93.            if not option then
  94.                return;
  95.            
  96.            local speed        :=    option[0].data;
  97.            local speedStr    :=    NumberStr(speed);
  98.        
  99.            local ecType    :=    option[1].data;
  100.            local ecTypeStr    :=    (    if BAND(ecType, kModemECProtocolExternal)    <> 0 then "Hardware"
  101.                                else if BAND(ecType, kModemECProtocolMNP)        <> 0 then "Software"
  102.                                else if BAND(ecType, kModemECProtocolNone)        <> 0 then "None"
  103.                                else "Unknown"    ) & " (" & NumberStr(ecType) & ")";
  104.        
  105.            :MMessage(    "Modem Speed: "    & speedStr    & unicodeCR &
  106.                        "EC Type: "        & ecTypeStr    & unicodeCR    );
  107.        end,
  108.      viewSetupDoneScript:
  109.        func()
  110.        begin
  111.            :MSetEndPointState(fEndPointState);        // do NOT change the endpoint state -- just update any views that depend on it
  112.            if fEndPointState = kState_Disconnected then
  113.                :MMessage(kMessage_Disconnected);
  114.            else
  115.                :MMessage("");
  116.        end,
  117.      MMessage:
  118.        func(message)        // this routine can be called regardless of the value of SELF
  119.        begin
  120.            local appBaseView := GetRoot().(kAppSymbol);
  121.            
  122.            if call kViewIsOpenFunc with (appBaseView) then
  123.                begin    
  124.                    SetValue(appBaseView.vMessage, 'text, Clone(message));
  125.                    RefreshViews();
  126.                end
  127.        end,
  128.      viewFormat: 83951953,
  129.      viewQuitScript:
  130.        func()
  131.        begin
  132.            :MDisconnect();
  133.            RemoveSlot(GetRoot().(kAppSymbol), 'fEndPoint);
  134.        end,
  135.      MConnect:
  136.        func(connectAction)
  137.        begin
  138.            if fEndPointState <> kState_Disconnected then
  139.                return;
  140.            
  141.            fEndPoint.fConnectAction := connectAction;
  142.            fEndPoint.fQuiet := nil;
  143.            
  144.            if connectAction = kAction_Listen then
  145.                :MSetEndPointState(kState_Listen);
  146.            else if connectAction = kAction_Connect then
  147.                begin
  148.                    if not StrFilled(vPhone.text) then
  149.                        return :MNotify(kMessage_NoPhoneNumber);
  150.                    
  151.                    fEndPoint.fConnectAddress := MakePhoneOption(vPhone.text);
  152.                
  153.                    :MSetEndPointState(kState_Connect);
  154.                end;
  155.            else
  156.                return;
  157.            
  158.            fEndPoint:MConnectAction();
  159.        end,
  160.      MDisconnectCompProc:
  161.        func(options, result)    // SELF is the endpoint frame
  162.        begin
  163.            try
  164.                :UnBind(nil)
  165.            onexception |evt.ex.comm| do
  166.                nil;
  167.            
  168.            try
  169.                :Dispose()
  170.            onexception |evt.ex.comm| do
  171.                nil;
  172.            
  173.            if fDisconnectSlip then begin
  174.                    fDisconnectSlip:Close();
  175.                    fDisconnectSlip := nil;
  176.                end;
  177.            
  178.            :MMessage(kMessage_Disconnected);
  179.            :MSetEndPointState(kState_Disconnected);
  180.            
  181.            if fPowerOffState then
  182.                begin
  183.                    fPowerOffState := nil;
  184.                    PowerOffResume(kAppSymbol);
  185.                end;
  186.            UnRegPowerOff(kAppSymbol);
  187.        end,
  188.      fEndPointOptions:
  189.        nil        // see MBuildConfigOptions & MConnectAction for more info
  190.        ,
  191.      MDisconnectAction:
  192.        func(fromState)        // SELF is the endpoint frame
  193.        begin
  194.            try
  195.                :Cancel(nil)
  196.            onexception |evt.ex.comm| do
  197.                nil;
  198.            
  199.            if fromState = kState_Connected then
  200.                try
  201.                    :Disconnect(nil, {    async:                true,
  202.                                        // reqTimeout:        3600,
  203.                                        completionScript:    func(ep, options, result)
  204.                                                            ep:MDisconnectCompProc(options, result),    })
  205.                onexception |evt.ex.comm| do
  206.                    :MDisconnectCompProc(nil, CurrentException().error);
  207.            else
  208.                :MDisconnectCompProc(nil, nil);
  209.        end,
  210.      MBuildConfigOptions:
  211.        func()        // SELF can be any frame that inherits to the app base view
  212.        begin
  213.            local options :=
  214.                [
  215.                    {    label:        kCMSModemID,            // "mods"
  216.                        type:        'service,
  217.                        result:        nil,
  218.                        opCode:        opSetRequired    },        // 512
  219.                    
  220.                    {    label:        kCMOModemECType,        // "mecp"
  221.                        type:        'option,
  222.                        opCode:        opSetNegotiate,            // 256
  223.                        result:        nil,
  224.                        form:         'template,
  225.                        data:    {
  226.                            arglist:[
  227.                                0,    ],
  228.                            typelist:['struct,
  229.                                'ulong,    ],    },    },
  230.                    
  231.                    {    label:        kCMOMNPCompression,        // "mnpc"
  232.                        type:        'option,
  233.                        opCode:        opSetNegotiate,            // 256
  234.                        result:        nil,
  235.                        form:         'template,
  236.                        data:    {
  237.                            arglist:[
  238.                                kMNPCompressionV42bis + kMNPCompressionMNP5 + kMNPCompressionNone,    ],    // 0000 0000 0000 1011
  239.                            typelist:['struct,
  240.                                'ulong,    ],    },    },
  241.                ];
  242.            
  243.            // set the negotiated error correction protocol (hardware and/or software and/or none)
  244.            local pos := ArrayPos(options, kCMOModemECType, 0, func(a,b) StrEqual(a,b.label));
  245.            if pos then
  246.                begin
  247.                    if vECHardware.viewValue
  248.                    or vECSoftware.viewValue then
  249.                        begin
  250.                            options[pos].data.arglist[0] := 0;
  251.                            if vECHardware.viewValue then
  252.                                options[pos].data.arglist[0] := Bor(options[pos].data.arglist[0], vECHardware.viewValue);
  253.                            if vECSoftware.viewValue then
  254.                                options[pos].data.arglist[0] := Bor(options[pos].data.arglist[0], vECSoftware.viewValue);
  255.                        end;
  256.                    else
  257.                        options[pos].data.arglist[0] := kModemECProtocolNone;
  258.                end;
  259.            
  260.            options;
  261.        end,
  262.      viewBounds: {left: -2, top: -2, right: 230, bottom: 310},
  263.      MExceptionHandler:
  264.        func(exceptionFrame)        // SELF is the endpoint frame
  265.        begin
  266.            if exceptionFrame
  267.            and exceptionFrame.data
  268.            and exceptionFrame.data <> -16005 then                // ignore -16005 (just the result of calling Cancel)
  269.                if exceptionFrame.data = -18003 then            // I/O buffer overrun
  270.                    begin
  271.                        AddDeferredCall(func(ep) ep:MResetConnection(true), [self]);
  272.                        :MNotifyError(exceptionFrame.data);
  273.                    end;
  274.                else begin                                        // handle all other (unexptected) exceptions by disconnecting the endpoint
  275.                        AddDeferredCall(func(ep) ep:MDisconnect(), [self]);
  276.                        :MNotifyError(exceptionFrame.data);
  277.                    end;
  278.            
  279.            true;
  280.        end,
  281.      _proto: @157,
  282.      MNotifyError:
  283.        func(error)
  284.        begin
  285.            if not error
  286.            or (fEndPoint and fEndPoint.fQuiet) then
  287.                return;
  288.            
  289.            if error = -10078 then
  290.                :MNotify(kMessage_PortInUse);
  291.            
  292.            else if error = -16013 then
  293.                :MNotify(kMessage_Timeout);
  294.            
  295.            else if error = -10008 then
  296.                :MNotify(kMessage_ModemNotFound);
  297.            
  298.            else if error = -24001 then
  299.                :MNotify(kMessage_ModemNoDialtone);
  300.            
  301.            else if error = -24002 or error = -24004 then
  302.                :MNotify(kMessage_ModemLineNoAnswer);
  303.            
  304.            else if error = -24003 then
  305.                :MNotify(kMessage_ModemPhoneLineBusy);
  306.            
  307.            else if error = -24000 or error = -24005 or error = -24007 then
  308.                :MNotify(kMessage_ModemNotResponding);
  309.            
  310.            else if error = -16009        // generic lost connection
  311.                 or error = -20003 then    // MNP lost connection
  312.                :MNotify(kMessage_LostConnection);
  313.            
  314.            else if error = -18003 then
  315.                :MNotify(kMessage_BufferOverrun);
  316.            
  317.            else if error = -20006 then
  318.                :MNotify(kMessage_ConnectECFailed);
  319.            
  320.            else if error = -38001 then
  321.                :MNotify(kMessage_ConnectFailed);
  322.            
  323.            else
  324.                :MNotify("An unexpected error has occured.  Error code = " & NumberStr(error));
  325.        end,
  326.      MResetConnection:
  327.        func(cancel)        // SELF is the endpoint frame
  328.        begin
  329.            if fEndPointState <> kState_Connected then
  330.                return;
  331.            
  332.            if cancel then
  333.                try
  334.                    :Cancel(nil)
  335.                onexception |evt.ex.comm| do
  336.                    nil;
  337.            
  338.            :SetInputSpec(fEndPointInputSpec);
  339.        end,
  340.      viewJustify: 80,
  341.      title: kAppName,
  342.      fEndPointState: kState_Disconnected,
  343.      fEndPointOutputSpec:
  344.        {
  345.            form:        'string,
  346.        },
  347.      MDisconnect:
  348.        func()
  349.        begin
  350.            if not fEndPoint
  351.            or fEndPointState <> kState_Connected
  352.            and fEndPointState <> kState_Connecting
  353.            and fEndPointState <> kState_Listening then
  354.                return;
  355.            
  356.            fEndPoint.fQuiet := true;        // supress user alerts and other interactions while disconnecting
  357.            
  358.            local fromState := fEndPointState;
  359.            :MSetEndPointState(kState_Disconnecting);
  360.            :MMessage(kMessage_Disconnecting);
  361.            
  362.            fEndPoint.fDisconnectSlip := BuildContext(GetLayout("protoDisconnectSlip"));
  363.            fEndPoint.fDisconnectSlip:Open();
  364.            
  365.            fEndPoint:MDisconnectAction(fromState);    
  366.        end,
  367.      fEndPoint: nil,
  368.      fEndPointInputSpec:
  369.        {
  370.            form:            'string,
  371.            termination:    {    endSequence:    [unicodeCR],    },
  372.            discardAfter:    256,
  373.            inputScript:    func(ep, data, terminator, options)
  374.                            ep:MInput(data),
  375.        },
  376.      viewSetupFormScript:
  377.        func()
  378.        begin
  379.            // make view no bigger than the original MP
  380.            local b := GetAppParams();
  381.            viewBounds := RelBounds( b.appAreaLeft,    b.appAreaTop,
  382.                                MIN( b.appAreaWidth, 240 ),
  383.                                MIN( b.appAreaHeight, 336 ));
  384.            
  385.            self.fEndPoint :=    {    _proto:                protoBasicEndPoint,
  386.                                    _parent:            self,
  387.                                    exceptionHandler:    MExceptionHandler,
  388.                                    fConnectAction:        nil,
  389.                                    fConnectAddress:    nil,
  390.                                    fDisconnectSlip:    nil,
  391.                                    fPowerOffState:        nil,
  392.                                    fQuiet:                nil,    };
  393.        end,
  394.      MOutput:
  395.        func(data)        // SELF can be any frame that inherits to the base app view
  396.        begin
  397.            if fEndPointState = kState_Connected then
  398.                try
  399.                    fEndPoint:Output(data & unicodeCR, nil, fEndPointOutputSpec)
  400.                onexception |evt.ex.comm| do
  401.                    :MExceptionHandler(CurrentException());
  402.            else
  403.                :MNotify("Not connected.");
  404.        end,
  405.      MSetEndpointState:
  406.        func(newState)        // this routine can be called regardless of the value of SELF
  407.        begin
  408.            local appBaseView := GetRoot().(kAppSymbol);
  409.            
  410.            //    NOTE: We must be absolutely certain fEndPointState gets created/overridden in the app base view frame!
  411.            appBaseView.fEndPointState := newState;
  412.            
  413.            if not call kViewIsOpenFunc with (appBaseView) then
  414.                return;
  415.            
  416.            if appBaseView.fEndPointState = kState_Disconnected then begin
  417.                    appBaseView.vConnect:Show();
  418.                    appBaseView.vListen:Show();
  419.                    appBaseView:MSetButtons("Connect", "Listen");
  420.                end;
  421.            
  422.            else if appBaseView.fEndPointState = kState_Listen then begin
  423.                    appBaseView.vConnect:Hide();
  424.                    appBaseView:MSetButtons("Listening", nil);
  425.                end;
  426.            
  427.            else if appBaseView.fEndPointState = kState_Listening then
  428.                    appBaseView:MSetButtons("Stop Listening", nil);
  429.            
  430.            else if appBaseView.fEndPointState = kState_Connect then begin
  431.                    appBaseView.vListen:Hide();
  432.                    appBaseView:MSetButtons("Connecting", nil);
  433.                end;
  434.            
  435.            else if appBaseView.fEndPointState = kState_Connecting then
  436.                    appBaseView:MSetButtons("Stop Connecting", nil);
  437.            
  438.            else if appBaseView.fEndPointState = kState_Connected then
  439.                    appBaseView:MSetButtons("Disconnect", nil);
  440.            
  441.            else if appBaseView.fEndPointState = kState_Disconnecting then
  442.                    appBaseView:MSetButtons("Disconnecting", nil);
  443.            
  444.            else
  445.                    appBaseView:MSetButtons("I Am Confused", nil);
  446.            
  447.            RefreshViews();
  448.        end,
  449.      MInput:
  450.        func(data)        // SELF is the endpoint frame
  451.        begin
  452.            PlaySound(ROM_PlinkBeep);
  453.            :MMessage(data);
  454.        end,
  455.      MConnectCompProc:
  456.        func(options, result)    // SELF is the endpoint frame
  457.        begin
  458.            if result then
  459.                begin
  460.                    :MNotifyError(result);
  461.                    :MDisconnect();
  462.                    return;
  463.                end;
  464.            
  465.            if fConnectAction = kAction_Listen then
  466.                try
  467.                    :Accept(nil, nil)
  468.                onexception |evt.ex.comm| do
  469.                    begin
  470.                        :MNotifyError(CurrentException().error);
  471.                        :MDisconnect();
  472.                        return;
  473.                    end;
  474.            
  475.            :MSetEndPointState(kState_Connected);
  476.            :MMessage(kMessage_Connected);
  477.            :MResetConnection(nil);
  478.            :MShowModemInfo();
  479.        end,
  480.      MConnectAction:
  481.        func()        // SELF is the endpoint frame
  482.        begin
  483.            fEndPointOptions := :MBuildConfigOptions();
  484.            
  485.            try
  486.                :Instantiate(self, fEndPointOptions)
  487.            onexception |evt.ex.comm| do
  488.                begin
  489.                    :MNotifyError(CurrentException().error);
  490.                    :MSetEndPointState(kState_Disconnected);
  491.                    return;
  492.                end;
  493.            
  494.            try
  495.                :Bind(nil, nil)
  496.            onexception |evt.ex.comm| do
  497.                begin
  498.                    :MNotifyError(CurrentException().error);
  499.                    :MSetEndPointState(kState_Disconnected);
  500.                    :Dispose();
  501.                    return;
  502.                end;
  503.            
  504.            RegPowerOff(kAppSymbol,
  505.                        func(what, why)        // we create the closure here so as to set up SELF as the endpoint frame in the closure
  506.                        begin
  507.                            if what = 'okToPowerOff then
  508.                                begin
  509.                                    if why <> 'idle                                    // keep the unit awake whenever we're connected
  510.                                    or fEndPointState = kState_Disconnected then    // unless the user or an application explicitly
  511.                                        return true;                                // wants it to sleep
  512.                                end;
  513.                            
  514.                            else if what = 'powerOff then
  515.                                begin
  516.                                    if why <> 'idle                                    // if we simply must go to sleep but we're still
  517.                                    and fEndPointState <> kState_Disconnected then    // connected then begin the disconnect process
  518.                                        begin
  519.                                            fPowerOffState := 'holdYourHorses;        // set a flag to indicate we're powering down
  520.                                            :MDisconnect();
  521.                                            return 'holdYourHorses;
  522.                                        end;
  523.                                end;
  524.                            
  525.                            nil;    // ALWAYS return nil here!
  526.                        end    );
  527.            
  528.            try
  529.                begin
  530.                    if fConnectAction = kAction_Listen then
  531.                        begin
  532.                            :MSetEndPointState(kState_Listening);
  533.                            :MMessage(kMessage_Listening);
  534.                            :Listen( nil,
  535.                                    {    async:                true,
  536.                                        reqTimeout:            90000,    // 90 seconds -- for DEMO purposes only
  537.                                        completionScript:    func(ep, options, result)
  538.                                                            ep:MConnectCompProc(options, result)    });
  539.                        end;
  540.                    else if fConnectAction = kAction_Connect then
  541.                        begin
  542.                            :MSetEndPointState(kState_Connecting);
  543.                            :MMessage(kMessage_Connecting);
  544.                            :Connect( [ fConnectAddress ],
  545.                                    {    async:                true,
  546.                                        reqTimeout:            45000,    // 45 seconds -- for DEMO purposes only
  547.                                        completionScript:    func(ep, options, result)
  548.                                                            ep:MConnectCompProc(options, result),    });
  549.                        end
  550.                end
  551.            onexception |evt.ex.comm| do
  552.                begin
  553.                    :MNotifyError(CurrentException().error);
  554.                    :MDisconnect();
  555.                end;
  556.        end,
  557.      debug: "vMainApp",
  558.      MNotify:
  559.        func(message)
  560.        begin
  561.            GetRoot():Notify(kNotifyAlert, kAppName, message);    // no longer necessary to EnsureInternal params
  562.        end,
  563.      MSetButtons:
  564.        func(connectText, listenText)
  565.        begin
  566.            SetValue(vConnect, 'text, connectText);
  567.            if listenText then
  568.                SetValue(vListen, 'text, listenText);
  569.            else
  570.                SetValue(vListen, 'text, connectText);
  571.        end
  572.     };
  573.  
  574. _view001 :=
  575.     {viewBounds: {left: 8, top: 16, right: 224, bottom: 32},
  576.      text: "Messages & Received Data:",
  577.      _proto: @218
  578.     };
  579. AddStepForm(vMainApp, _view001);
  580.  
  581.  
  582.  
  583. vMessage :=
  584.     {viewBounds: {left: 9, top: 33, right: 223, bottom: 119},
  585.      viewJustify: 0,
  586.      viewFormat: 337,
  587.      viewFont: simpleFont12,
  588.      text: "",
  589.      viewClickScript:
  590.        func(unit)
  591.        begin
  592.            SetValue(self, 'text, "");
  593.            true;
  594.        end,
  595.      viewFlags: 515,
  596.      debug: "vMessage",
  597.      _proto: @218
  598.     };
  599. AddStepForm(vMainApp, vMessage);
  600. StepDeclare(vMainApp, vMessage, 'vMessage);
  601.  
  602.  
  603.  
  604. _view002 :=
  605.     {viewBounds: {left: 8, top: 128, right: 168, bottom: 144},
  606.      text: "Message To Send:",
  607.      _proto: @218
  608.     };
  609. AddStepForm(vMainApp, _view002);
  610.  
  611.  
  612.  
  613. vInputArea :=
  614.     {viewFlags: 64001,
  615.      viewFormat: 12625,
  616.      viewLineSpacing: 20,
  617.      viewFont: 18434,
  618.      viewBounds: {left: 9, top: 145, right: 167, bottom: 195},
  619.      text: "This is a test!",
  620.      debug: "vInputArea",
  621.      viewClass: 81
  622.     };
  623. AddStepForm(vMainApp, vInputArea);
  624. StepDeclare(vMainApp, vInputArea, 'vInputArea);
  625.  
  626.  
  627.  
  628. vConnect :=
  629.     {
  630.      buttonClickScript:
  631.        func()
  632.        begin
  633.            if fEndPointState = kState_Disconnected then
  634.                :MConnect(kAction_Connect);
  635.            else
  636.                :MDisconnect();
  637.        end,
  638.      viewBounds: {left: 122, top: 222, right: 222, bottom: 242},
  639.      text: ""
  640.      ,
  641.      debug: "vConnect",
  642.      _proto: @226
  643.     };
  644. AddStepForm(vMainApp, vConnect);
  645. StepDeclare(vMainApp, vConnect, 'vConnect);
  646.  
  647.  
  648.  
  649. vListen :=
  650.     {
  651.      buttonClickScript:
  652.        func()
  653.        begin
  654.            if fEndPointState = kState_Disconnected then
  655.                :MConnect(kAction_Listen);
  656.            else
  657.                :MDisconnect();
  658.        end,
  659.      viewBounds: {left: 122, top: 250, right: 222, bottom: 270},
  660.      text: ""
  661.      ,
  662.      debug: "vListen",
  663.      _proto: @226
  664.     };
  665. AddStepForm(vMainApp, vListen);
  666. StepDeclare(vMainApp, vListen, 'vListen);
  667.  
  668.  
  669.  
  670. vSend :=
  671.     {
  672.      buttonClickScript:
  673.        func()
  674.        begin
  675.            :MOutput(if vInputArea.text then vInputArea.text else "");
  676.        end,
  677.      viewBounds: {left: 178, top: 146, right: 222, bottom: 166},
  678.      text: "Send",
  679.      debug: "vSend",
  680.      _proto: @226
  681.     };
  682. AddStepForm(vMainApp, vSend);
  683. StepDeclare(vMainApp, vSend, 'vSend);
  684.  
  685.  
  686.  
  687. vInfo :=
  688.     {
  689.      buttonClickScript:
  690.        func()
  691.        begin
  692.            :MShowModemInfo();
  693.        end,
  694.      viewBounds: {left: 178, top: 174, right: 222, bottom: 194},
  695.      text: "Info",
  696.      debug: "vInfo",
  697.      _proto: @226
  698.     };
  699. AddStepForm(vMainApp, vInfo);
  700. StepDeclare(vMainApp, vInfo, 'vInfo);
  701.  
  702.  
  703.  
  704. _view003 :=
  705.     {viewBounds: {left: 8, top: 204, right: 112, bottom: 220},
  706.      text: "Phone Number:",
  707.      _proto: @218
  708.     };
  709. AddStepForm(vMainApp, _view003);
  710.  
  711.  
  712.  
  713. vPhone :=
  714.     {viewFlags: 305665,
  715.      viewFormat: 12625,
  716.      viewLineSpacing: 20,
  717.      viewFont: 18434,
  718.      viewBounds: {left: 9, top: 221, right: 111, bottom: 271},
  719.      viewSetupFormScript:
  720.        func()
  721.        begin
  722.            // text := Clone(userConfiguration.mailPhone);
  723.            text := "257-8203";
  724.        end,
  725.      text: "",
  726.      debug: "vPhone",
  727.      viewClass: 81
  728.     };
  729. AddStepForm(vMainApp, vPhone);
  730. StepDeclare(vMainApp, vPhone, 'vPhone);
  731.  
  732.  
  733.  
  734. _view004 :=
  735.     {viewBounds: {left: 8, top: 279, right: 104, bottom: 295},
  736.      text: "Use EC protocol in:",
  737.      _proto: @218
  738.     };
  739. AddStepForm(vMainApp, _view004);
  740.  
  741.  
  742.  
  743. vECHardware :=
  744.     {text: "Hardware",
  745.      viewBounds: {left: 104, top: 276, right: 168, bottom: 292},
  746.      buttonValue: kModemECProtocolExternal,
  747.      debug: "vECHardware",
  748.      _proto: @164
  749.     };
  750. AddStepForm(vMainApp, vECHardware);
  751. StepDeclare(vMainApp, vECHardware, 'vECHardware);
  752.  
  753.  
  754.  
  755. vECSoftware :=
  756.     {text: "Software",
  757.      viewBounds: {left: 168, top: 276, right: 228, bottom: 292},
  758.      buttonValue: kModemECProtocolMNP,
  759.      debug: "vECSoftware",
  760.      _proto: @164
  761.     };
  762. AddStepForm(vMainApp, vECSoftware);
  763. StepDeclare(vMainApp, vECSoftware, 'vECSoftware);
  764.  
  765.  
  766.  
  767.  
  768. constant |layout_Basic Modem.t| := vMainApp;
  769. // End of file Basic Modem.t
  770.  
  771.  
  772.  
  773.